package com.dabaozhan.modules.wx_app.service.impl;

import com.dabaozhan.common.utils.Utils;
import com.dabaozhan.modules.wx_app.dao.SmsMapper;
import com.dabaozhan.modules.wx_app.entity.SmsEntity;
import com.dabaozhan.modules.wx_app.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author houzhong
 * @date 2019-01-07 11:40
 */
@Service("smsService")
public class SmsServiceImpl implements SmsService {

    @Autowired
    private SmsMapper smsMapper;

    @Override
    public int saveSms(SmsEntity v) {
        if (v.getId() == null) {
            v.setId(Utils.id().toString());
        }
        return smsMapper.save(v);
    }

    @Override
    public int findBySmsCount(SmsEntity v) {

        return smsMapper.findBySmsCount(v);
    }

    @Override
    public List<SmsEntity> findPhone(SmsEntity v) {
        return smsMapper.findPhone(v);
    }
}
